<!--
    * Time    : 2020-12-28 14:27:10
    * Author  : zhangTj
    * Desc    : 余额充值记录
-->

<template>
    <div class="w750 bg-fff">
        <div>
            <van-list
                v-model="paging.loading"
                :finished="paging.finished"
                finished-text="没有更多了"
                @load="onLoad"
                :immediate-check="false"
                v-if="paging.tab"
            >
                <div
                    @click="$toPage('balanceRecordDetail', { recordId: item.rechargeNumber })"
                    v-for="item in list"
                    :key="item.id"
                    class="px-2 py-1 d-flex font-14 border-bottom a-center"
                >
                    <div class="d-flex flex-column j-sa flex-1">
                        <span>余额充值</span>
                        <span class="font-12 mt text-999">{{ item.createTime | dateformat }}</span>
                    </div>
                    <div class="text-danger font-16 font-weight">+￥{{ money(item.amount)[0] }}.{{ money(item.amount)[1] }}</div>
                </div>
            </van-list>
        </div>
        <Noempty :pic="require('@/assets/images/review.png')" :title="'暂无相关充值记录'" v-if="paging.emptylist && !paging.error" />
    </div>
</template>

<script>
import Noempty from 'components/Noempty/Noempty'
import PageUtil from 'utils/PageUtil'
import { predepositRechargeList } from '@/api/balance'
import cash from 'utils/tool'

const pageUtil = new PageUtil(predepositRechargeList)

export default {
    name: '',
    components: { Noempty },
    data() {
        return {
            paging: {
                tab: true,
                loading: false,
                finished: false,
                error: false, // 是否错误
                emptylist: false // 是否显示列表为空时的样式
            },
            list: [],
            money: cash
        }
    },
    computed: {},
    watch: {},
    created() {},
    destroyed() {},
    mounted() {
        pageUtil.loadListByPage(this)
    },
    methods: {
        //下垃加载请求
        onLoad() {
            pageUtil.loadListByPageMore()
        }
    }
}
</script>

<style lang="scss" scoped></style>
